from appium.webdriver.webdriver import WebDriver


class BasePage:
    def __init__(self, driver:WebDriver=None):
        self.driver = driver


    def find(self, by, locator):
        return self.driver.find_element(by, locator)

    def finds(self, by, locator):
        return self.driver.find_elements(by, locator)

    def find_and_click(self, by, locator):
        self.find(by, locator).click()

    def find_and_send(self, by, locator, text):
        self.find(by, locator).send_keys(text)